<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>资讯详情</title>
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>

    <link rel="stylesheet" href="../js/libs/sui/sm.min.css">
    <link rel="stylesheet" href="../js/libs/sui/sm-extend.min.css">
    <link rel="stylesheet" href="../iconfont/iconfont.css">
    <link rel="stylesheet" href="../less/main.css"/>

    <script type="text/javascript" src='../js/libs/jquery-3.1.0.min.js' charset='utf-8'></script>
    <script type="text/javascript">
        var Zepto = jQuery;
    </script>
    <script type="text/javascript" src='../js/libs/sui/sm.js' charset='utf-8'></script>
    <script type="text/javascript" src='../js/libs/sui/sm-extend.min.js' charset='utf-8'></script>
    <script type="text/javascript" src="../js/libs/juicer-min.js"></script>
    <script type="text/javascript" src="../js/libs/jquery.md5.js"></script>
    <script type="text/javascript" src="../js/api.js"></script>
    <script type="text/javascript" src="../js/utils.js"></script>
    <script type="text/javascript" src="../js/common.js"></script>
</head>
<body>
<div class="page">
    <!-- 标题栏 -->
    <header class="bar bar-nav">
        <a class="icon iconfont c-white pull-left" onclick="javascript:api.closeWin();">&#xe61f;</a>
        <!--<a class="icon icon-refresh pull-right"></a>-->
        <h1 class="title">资讯详情</h1>
    </header>
    <div class="content bg-white">
        <!--资讯详情-->
        <div class="news-detail">
            <!--&lt;!&ndash; 头部&ndash;&gt;-->
            <!--<div class="head-no-toolbar no-left-icon">-->
                <!--<span class="icon iconfont c-white p-l" onclick="javascript:api.closeWin();">&#xe61f;</span>-->
                <!--<span class="c-white t-center">资讯详情</span>-->
            <!--</div>-->
            <div id="news-detail">
                <!--
                <h1 class="news-detail-title">我是新闻标题啊我是新闻标题啊</h1>
                <h5 class="news-detail-time c-gray">2016-07-21 10:35:23</h5>

                <div class="content-padded border-t p-t t-center">
                    <img class="w-100p" src="public/images/my-center-header.jpg" alt=""/>

                    <p class="news-paragraph">
                        我是段落文字我是段落文字我是段落文字我是段落文字我是段落文字
                        我是段落文字我是段落文字我是段落文字我是段落文字我是段落文字
                    </p>

                    <p class="news-paragraph">
                        我是段落文字我是段落文字我是段落文字我是段落文字我是段落文字
                        我是段落文字我是段落文字我是段落文字我是段落文字我是段落文字
                        我是段落文字我是段落文字我是段落文字我是段落文字我是段落文字
                    </p>
                    <img class="w-100p" src="public/images/lunbo.jpg" alt=""/>

                    <p class="news-paragraph">
                        我是段落文字我是段落文字我是段落文字我是段落文字我是段落文字
                        我是段落文字我是段落文字我是段落文字我是段落文字我是段落文字
                        我是段落文字我是段落文字我是段落文字我是段落文字我是段落文字
                    </p>
                </div>
                -->
            </div>
        </div>
    </div>
</div>
<script id="news-tpl" type="text/template">
    {@each news as it,index}
        {@if (it.TITLE != null) && (it.TITLE != '')}
            <h1 class="news-detail-title">&{it.TITLE}</h1>
        {@/if}

        {@if (it.PUBLSIH_DATE != null) && (it.PUBLSIH_DATE != '')}
            <h5 class="news-detail-time c-gray">&{it.PUBLSIH_DATE}</h5>
        {@/if}

        {@if (it.WAP_CONTENT != null) && (it.WAP_CONTENT != '')}
            <div class="content-padded border-t p-t t-center">
                $${it.WAP_CONTENT}
            </div>
        {@/if}
    {@/each}
</script>

<script type="text/javascript">
    apiready = function () {
        juicer.set({
            'tag::operationOpen': '{@',
            'tag::operationClose': '}',
            'tag::interpolateOpen': '&{',
            'tag::interpolateClose': '}',
            'tag::noneencodeOpen': '$${',
            'tag::noneencodeClose': '}',
            'tag::commentOpen': '{#',
            'tag::commentClose': '}',
            'strip': false,
            'cache': false
        });

        var newssql = "SELECT C.*,(SELECT T.WEB_CONTENT FROM CMS_CONTENT_TXT T WHERE T.CONTENT_ID=C.CONTENT_ID LIMIT 0,1) WAP_CONTENT FROM cms_content C WHERE C.CONTENT_ID='{0}'";

        if (isNotNull(api.pageParam.zixunId)) {
            newssql = newssql.format(api.pageParam.zixunId);

            dbQuery(1, 1, newssql, true, function (ret, err) {
                if (isObject(ret)&&ret.statusCode == 0) {
                    var newsData = {
                        news: ret.result,
                        url: getUrl()
                    };

                    $("#news-detail").html(juicer($("#news-tpl").html(), newsData));

                    $('.news-detail .content-padded img').each(function(){
                        var src=$(this).attr('src');
                        if(src.indexOf("/upload/image/")>=0){
                            $(this).attr('src',getUrl()+$(this).attr('src'));
                        }
                    });
                }
            });
        }

    };
</script>
</body>
</html>